<template>
  <v-row>
    <v-col cols="4">
      <v-card class="mx-auto" max-width="auto" outlined>
        <v-toolbar dark tabs flat color="success">
          <v-app-bar-nav-icon></v-app-bar-nav-icon>
          <v-toolbar-title>基本信息</v-toolbar-title>
        </v-toolbar>

        <v-container>
          <v-row>
            <v-col cols="auto">
              <v-img :src="employee.photoUrl" height="300" width="300"></v-img>
            </v-col>

            <v-col cols="auto">
              <v-list shaped>
                <v-subheader>
                  <p class="font-weight-bold">{{employee.name}}</p>
                </v-subheader>
                <v-list-item-group color="primary">
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">工号</span>
                        </var> :
                        <var>{{employee.code}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">身份证号码</span>
                        </var> :
                        <var>{{employee.idCard}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">性别</span>
                        </var> :
                        <var>{{employee.sex==0 ? '女':'男'}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">民族</span>
                        </var> :
                        <var>{{employee.nation}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">出生日期</span>
                        </var> :
                        <var>{{employee.birth==''||employee.birth==null?'未定义':employee.birth}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">籍贯</span>
                        </var> :
                        <var>{{employee.birthplace==null?'未录入':employee.birthplace}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">婚姻状况</span>
                        </var> :
                        <var>
                          <span v-show="employee.marital===0">未婚</span>
                          <span v-show="employee.marital===1">已婚</span>
                          <span v-show="employee.marital===2">丧偶</span>
                          <span v-show="employee.marital===3">离异</span>
                        </var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">政治面貌</span>
                        </var> :
                        <var>{{employee.political.name}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">员工状态</span>
                        </var> :
                        <var>
                          <span v-show="employee.status===0">在职</span>
                          <span v-show="employee.status===1">返聘</span>
                          <span v-show="employee.status===2">临时聘用</span>
                          <span v-show="employee.status===3">退休</span>
                          <span v-show="employee.status===4">辞职</span>
                          <span v-show="employee.status===9">其他</span>
                          <span v-show="employee.status===11">发起离职申请</span>
                        </var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>

                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">所属公司</span>
                        </var> :
                        <var>{{employee.company.name}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">所属部门</span>
                        </var> :
                        <var>{{employee.department.name}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">进所时间</span>
                        </var> :
                        <var>{{employee.entryTime==''||employee.entryTime==null?'未定义':employee.entryTime}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">管理职级</span>
                        </var> :
                        <var>{{employee.manageRank==null||employee.manageRank==''?'无':employee.manageRank}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">业务职级</span>
                        </var> :
                        <var>{{employee.businessRank==null||employee.businessRank==''?'无':employee.businessRank}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">职务</span>
                        </var> :
                        <var>{{employee.titleRank==null||employee.titleRank==''?'无':employee.titleRank}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">家庭地址</span>
                        </var> :
                        <var>{{employee.address}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>

                  <v-list-item>
                    <v-list-item-content>
                      <v-list-item-title>
                        <var>
                          <span class="font-weight-black">联系电话</span>
                        </var> :
                        <var>{{employee.telphone}}</var>
                      </v-list-item-title>
                    </v-list-item-content>
                  </v-list-item>
                </v-list-item-group>
              </v-list>
            </v-col>
          </v-row>
        </v-container>
      </v-card>
    </v-col>
    <v-divider vertical></v-divider>
    <v-col cols="7">
      <v-card>
        <v-toolbar dark tabs flat color="indigo">
          <v-app-bar-nav-icon></v-app-bar-nav-icon>
          <v-toolbar-title>其他信息</v-toolbar-title>
          <v-spacer></v-spacer>

          <template v-slot:extension>
            <v-tabs align-with-title v-model="tab">
              <v-tab key="register">执业资格信息</v-tab>
              <v-tab key="rankChange">职级变动</v-tab>
              <v-tab key="social">社会任职</v-tab>
              <v-tab key="teaching">授课记录</v-tab>
              <v-tab key="paper">论文(著作)发表情况</v-tab>
              <v-tab key="honor">荣誉记录</v-tab>
              <v-tab key="hobby">特长爱好</v-tab>
              <v-tab key="family">家庭成员</v-tab>
              <v-tab key="leave">请休假</v-tab>
              <v-tabs-slider color="pink"></v-tabs-slider>
            </v-tabs>
          </template>
        </v-toolbar>
        <v-card-text>
          <v-tabs-items v-model="tab">
            <v-tab-item key="register">
              <v-card height="auto" flat>
                <v-card-title>执业资格信息</v-card-title>
                <v-card-text>
                  <v-data-table :headers="registerColumns" :items="registerData"></v-data-table>
                </v-card-text>
              </v-card>
            </v-tab-item>
            <v-tab-item key="rankChange">
              <v-card height="auto" flat>
                <v-card-title>职级变动信息</v-card-title>
                <v-card-text>
                  <v-data-table :headers="rankChangeColumns" :items="rankChangeData">
                    <template v-slot:item.promotionType="{item}">{{item.promotionType.name}}</template>
                    <template v-slot:item.promotionRank="{item}">{{item.promotionRank.rankName}}</template>
                  </v-data-table>
                </v-card-text>
              </v-card>
            </v-tab-item>
            <v-tab-item key="social">
              <v-card height="auto" flat>
                <v-card-title>社会任职情况</v-card-title>
                <v-card-text>
                  <v-data-table :headers="socialColumns" :items="socialData"></v-data-table>
                </v-card-text>
              </v-card>
            </v-tab-item>

            <v-tab-item key="teaching">
              <v-card height="auto" flat>
                <v-card-title>授课记录</v-card-title>
                <v-card-text>
                  <v-data-table :headers="teachingColumns" :items="teachingData">
                    <template v-slot:item.teachingType="{item}">
                      <span>{{item.teachingType==1?'内部':'外部'}}</span>
                    </template>
                  </v-data-table>
                </v-card-text>
              </v-card>
            </v-tab-item>

            <v-tab-item key="paper">
              <v-card height="auto" flat>
                <v-card-title>论文(著作)发表情况</v-card-title>
                <v-card-text>
                  <v-data-table :headers="paperColumns" :items="paperData"></v-data-table>
                </v-card-text>
              </v-card>
            </v-tab-item>

            <v-tab-item key="honor">
              <v-card height="auto" flat>
                <v-card-title>荣誉记录</v-card-title>
                <v-card-text>
                  <v-data-table :headers="honorColumns" :items="honorData"></v-data-table>
                </v-card-text>
              </v-card>
            </v-tab-item>

            <v-tab-item key="hobby">
              <v-card height="auto" flat>
                <v-card-title>特长爱好</v-card-title>
                <v-card-text>
                  <v-data-table :headers="hobbyColumns" :items="hobbyData"></v-data-table>
                </v-card-text>
              </v-card>
            </v-tab-item>

            <v-tab-item key="family">
              <v-card height="auto" flat>
                <v-card-title>家庭成员</v-card-title>
                <v-card-text>
                  <v-data-table :headers="familyColumns" :items="familyData"></v-data-table>
                </v-card-text>
              </v-card>
            </v-tab-item>

            <v-tab-item key="leave">
              <v-card height="auto" flat>
                <v-card-title>请休假</v-card-title>
                <v-card-text>
                  <v-data-table :headers="leaveColumns" :items="leaveData">
                    <template v-slot:item.leaveType="{item}">
                      <span>{{item.leaveType.name}}</span>
                    </template>
                  </v-data-table>
                </v-card-text>
              </v-card>
            </v-tab-item>
          </v-tabs-items>
        </v-card-text>
      </v-card>
    </v-col>
  </v-row>
</template>

<script>
export default {
  props: {
    employee: Object,
    registerData: Array,
    rankChangeData: Array,
    socialData: Array,
    teachingData: Array,
    paperData: Array,
    honorData: Array,
    hobbyData: Array,
    familyData: Array,
    leaveData: Array
  },
  data() {
    return {
      tab: null,
      registerColumns: [
        {
          text: "资格名称",
          value: "registerType",
          width: 200
        },
        {
          text: "执业资格所属公司",
          value: "registerCompName",
          width: 200
        },
        {
          text: "姓名",
          value: "name",
          width: 150
        },

        {
          text: "部门",
          value: "department",
          width: 200
        },
        {
          text: "学历",
          value: "education",
          width: 200
        },
        {
          text: "执业资格批准文号",
          value: "registerDocumentNum",
          width: 200
        },
        {
          text: "资格证号",
          value: "registerCode",
          width: 200
        },
        {
          text: "全科合格证号",
          value: "allSubjectCode",
          width: 200
        },
        {
          text: "后续教育证号",
          value: "upEducationCode",
          width: 200
        },
        {
          text: "取得方式",
          value: "getType",
          width: 200
        },
        {
          text: "资格证书获得时间",
          value: "getRegisterTime",
          width: 200
        },
        {
          text: "合格时间",
          value: "qualifiedTime",
          width: 200
        },
        {
          text: "执业资格状态",
          value: "registerStatus",
          width: 200
        },
        {
          text: "备注",
          value: "remarks",
          width: 200
        },
        {
          text: "修改时间",
          key: "updateTime",
          width: 200
        }
      ],
      rankChangeColumns: [
        {
          text: "晋升批次名称",
          value: "changeName",
          width: 150
        },
        {
          text: "部门",
          value: "department",
          width: 150
        },
        {
          text: "姓名",
          value: "name",

          width: 100
        },
        {
          text: "晋升前业务职级",
          value: "businessRank",

          width: 200
        },
        {
          text: "晋升前管理职级",
          value: "manageRank",

          width: 200
        },
        {
          text: "执业资格情况",
          value: "register",
          width: 150
        },
        {
          text: "晋升类型",
          value: "promotionType",

          width: 150
        },

        {
          text: "晋升后职级",
          value: "promotionRank",

          width: 200
        },
        {
          text: "晋升生效时间",
          value: "validTime",
          //slot:'validTime',
          width: 200
        },
        {
          text: "人力资源部审核状态",
          value: "hrApproval",

          width: 200
        },
        {
          text: "人力资源部审核意见",
          value: "hrProposal",

          width: 200
        },
        {
          text: "部门审核状态",
          value: "depApproval",

          width: 150
        },
        {
          text: "部门审核意见",
          value: "depProposal",

          width: 200
        },

        {
          text: "现场考核得分",
          value: "onAssessResults",
          width: 150
        },
        {
          text: "项目考核得分",
          value: "projectAssessResults",
          width: 150
        },
        {
          text: "综合得分",
          value: "sumResults",
          width: 120
        }
      ],
      socialColumns: [
        {
          text: "职位名称",
          value: "posName"
        },
        {
          text: "任职单位",
          value: "posDepartment"
        },
        {
          text: "开始时间",
          value: "startDate"
        },
        {
          text: "结束时间",
          value: "endDate"
        },
        {
          text: "任期时效",
          value: "socialTime"
        }
      ],
      teachingColumns: [
        {
          text: "授课类型",
          value: "teachingType"
        },
        {
          text: "课程名称",
          value: "teachingName"
        },
        {
          text: "授课地点",
          value: "teachingAddress"
        },
        {
          text: "承办机构",
          value: "teachingDepartment"
        },
        {
          text: "开始时间",
          value: "startDate"
        },
        {
          text: "结束时间",
          value: "endData"
        }
      ],
      paperColumns: [
        {
          text: "类别",
          value: "paperType"
        },
        {
          text: "题目",
          value: "name"
        },
        {
          text: "发表时间",
          value: "getDate"
        },
        {
          text: "登载地",
          value: "paperDepartment"
        },
        {
          text: "刊号",
          value: "paperNumber"
        },
        {
          text: "字数（千字）",
          value: "paperCount"
        }
      ],
      honorColumns: [
        {
          text: "荣誉名称",
          value: "name"
        },
        {
          text: "授予时间",
          value: "getDate"
        },
        {
          text: "授予单位",
          value: "honorDepartment"
        },
        {
          text: "证书或文件",
          value: "honorFile"
        }
      ],
      hobbyColumns: [
        {
          text: "特长爱好",
          value: "name"
        },
        {
          text: "等级",
          value: "level"
        }
      ],
      familyColumns: [
        {
          text: "出生日期",
          value: "birth"
        },
        {
          text: "姓名",
          value: "socName"
        },
        {
          text: "关系",
          value: "socialJoin"
        },
        {
          text: "工作单位",
          value: "company"
        },
        {
          text: "职务",
          value: "socPost"
        },
        {
          text: "联系电话",
          value: "phone"
        }
      ],
      leaveColumns: [
        {
          text: "请假类别",
          value: "leaveType"
        },
        {
          text: "开始日期",
          value: "leaveStart"
        },
        {
          text: "结束日期",
          value: "leaveEnd"
        },
        {
          text: "请假说明",
          value: "leaveDesc"
        },
        {
          text: "总天数",
          value: "leaveDay"
        }
      ]
      //registerData:[],
    };
  },
  methods: {},
  created() {},
  mounted() {},
  computed: {}
};
</script>
